Creating your own music files for use with Tetris Max requires using ResEdit. If you're not familiar with ResEdit, it's a resource editor made by Apple. Resources are special pieces of data in an application or data file, like a sound or a picture. Using ResEdit, you can change these resources, thereby causing the program that uses the resources to exhibit new behavior. For instance, you might edit some of the graphics resources of Tetris Max to make all the pieces look like they're made out of miniature teddy bears. If you don't already have a copy, you should be able to find ResEdit from a local Macintosh user group, or if you have a connection to the internet, you can ftp it from ftp.apple.com.
ResEdit is not for the faint of heart. It is possible to completely trash a file by screwing up its resources with ResEdit, so always work with a copy of the file, never the original. It's not the most friendly and intuitive program around, either. However, if you exercise common sense and work on a copy, you should be able to accomplish a great deal using ResEdit, and no one will get hurt. Attempting to explain how to use it is a huge task, so this document will assume you already know your way around ResEdit fairly well.
Using ResEdit, create a new ResEdit document. Change its creator to "log_" and its type to "tMUS". You will add your music segments to this document as "snd " resources.
Now digitize some music using your favorite digitizer. Using a program such as SoundEditPro or Sample Editor, break the music up into segments. If there are themes or refrains in the music which repeat, you need only make a single segment for each. When you're done, you should be able to play the whole song by stringing segments together, perhaps repeating some. Add these segments as "snd " resources to your newly created file, giving them appropriate names.
For example, if my song had the logical structure ABACAB, I would cut segments out of the full-length song corresponding to sections A,B, and C. I would then add three "snd " resources to my ResEdit document, and name them A, B, and C.
For Tetris Max to play your music, you need to tell it in what order your segments should be played. Essentially, you just list the order, so for the example above I would give Tetris Max the order "A,B,A,C,A,B." When it reaches the end of the order you've specified, Tetris Max starts over at the beginning, so I would end up with music playing ABACABABACABABACAB...
You can also make Tetris Max loop back to someplace other than the beginning of the order after it reaches the end. This is useful if your music has some kind of "intro" to it that you only want to play on the first pass through, but not on the loop-backs. Simply rename the sound segment that you want Tetris Max to loop back to "repeat". So if what I really wanted was ABACABCABCABCAB..., I would rename the sound segment "C" "repeat". Then I would give Tetris Max the order "A,B,A,repeat,A,B". If the repeat sound appears more than once in the order, it must be called "repeat" at every occurence. Thus "A,B,repeat,A,repeat,B,A" is acceptable, but "A,B,repeat,A,C,B,A" is not.
How exactly is the order given to Tetris Max? It is specified in a STR# resource. Create a new STR# resource with ID 128. The name of the first segment in the order goes at index 1, the second at index 2, and so on. So for the example, I would put "A" at index 1, "B" at index 2, "repeat" at index 3, "A" at 4, and "B" at 5.
That's it! You should also put a description of your music, with information such as the title, author, etc, in STR# resource ID 129, index 1. This string will be displayed whenever the user selects the "about background music" option from the apple menu. Here's your chance for fame!
Some things to watch out for:
• The snd resources must all be format 1 resources. For most people this is the default anyway, so you shouldn't need to worry about this.
• If the sound segments are very large, the memory allotted to Tetris Max (in the Finder's "Get Info" box) may need to be increased in order for things to work properly. If things are crashing inexplicably or the music turns to noise, try increasing the memory allocated to the program. This is especially true if the snd resources are marked "locked" in the music file.
• If the snd resources are marked "purgeable", you may be able to get away with allocating less memory to Tetris Max. The program will attempt to dynamically load and purge the sounds as they are needed. However, marking the resouces "purgeable" can result in audible delays between music segments as the next segment is loaded from disk.
• I've had problems with the music turning to noise when the snd resources are neither "locked" nor "purgeable", so proceed at your own risk if you try this. It is probably due to confused code or a bug in the main program.
If you enjoy Tetris Max and play it often, PLEASE send in the $10 shareware fee. It is not very much compared to the cost of a commercial game, and it motivates me to keep improving Tetris Max as well as to work on new games. By even the most optimistic estimate, less than 2% of the people who have older versions of Tetris Max have actually sent in the shareware fee. If you play, please pay.
Questions? Comments? I'd love to hear them! Contact me at: